<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <p>{{ num }}</p>
        <button @click="handleNum">handleNum</button>
        <button @click="vueDelete">vueDelete</button>
    </div>
    <script>
        var arr = [1, 2, 3, 4]
        delete arr[1]
        console.log('js原生', arr)
        console.log('js原生', arr.length)
        let vm = new Vue({
            el: '#app',
            data: {
                num: 10,
                arr: [1, 2, 3, 4]
            },
            methods: {
                handleNum() {
                    vm.num++
                },
                vueDelete() {
                    vm.$delete(vm.arr, 1)
                    console.log('vue', vm.arr)
                }
            }
        })
    </script>

</body>

</html>